package com.yycwxt.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@TableName("core_subject")
public class Subject {


    @TableId(type = IdType.AUTO)
    private Integer id;
    @NotBlank(message = "不能为空")
    @NotNull(message = "不能为空")
    @Length(min = 4, max = 12, message = "长度必须在4到12之间")
    private String code;
    private String name;
    @NotNull(message = "不能为空")
    @Min(value = -1, message = "最小值为-1")
    @Max(value = 1, message = "最大值为1")
    private Integer direction;
    @NotBlank(message = "不能为空")
    @NotNull(message = "不能为空")
    private String fullname;
    private String remark;
    private LocalDateTime created;

}
